<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-04 15:22:10
 * @LastEditTime: 2023-07-08 10:13:12
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 
 */

namespace App\Providers;

use App\Models\BaseModel;

use App\Models\User;
use Illuminate\Support\ServiceProvider;
use EasyWeChat\MiniApp\Application as MiniAppServer;

class MiniProServiceProvider extends ServiceProvider
    {
    public $defaultconfig = [
        'app_id' => '',
        'secret' => '',
        'http'   => [
            'throw'   => true, // 状态码非 200、300 时是否抛出异常，默认为开启
            'timeout' => 5.0,
            'retry'   => true, // 使用默认重试配置 
        ],
    ];

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
        {
        //
        }

    /**
     * Boot the authentication services for the application.
     *
     * @return void
     */
    public function boot()
        {
        $this->app['MiniApp'] = function ()
            {
            return new MiniAppServer($this->defaultconfig);
            };
        }
    }